import request from '@/utils/request';

// 查询商品基本信息列表
export function listGoods(params) {
	return request({
		url: '/api/pc/ptGoods/ptDetail',
		method: 'get',
		params,
	});
}

// 查询拼团商品基本信息详细
export function getPtDitails(params) {
	return request({
		url: '/api/pc/ptGoods/lotteryUsersList',
		method: 'get',
		params,
	});
}

export const updateGoodsPo = (data) => {
	return request({
		url: '/api/pc/ptGoods/startNextEpisode',
		method: 'post',
		data: data,
	});
};

export const updatePtUser = (data, type, ptId) => {
	return request({
		url: '/api/pc/ptGoods/ptBatchCancelSelected?type=' + type + '&ptId=' + ptId,
		method: 'post',
		data: data,
	});
};

export const getLotteryDetailInfo = (params) => {
	return request({
		url: '/api/pc/ptGoods/lotteryDetailInfo',
		method: 'get',
		params,
	});
};

export const addPtCount = (data) => {
	return request({
		url: '/api/pc/ptGoods/addPtNumber/' + data.id + '/' + data.count,
		method: 'put',
	});
};
export function queryPtPeriodsList(data) {
	return request({
		url: '/api/pc/ptGoods/queryPtPeriodsList',
		method: 'post',
		data,
	});
}
export function updatePtTime(data) {
	return request({
		url: '/api/pc/ptGoods/updatePtTime',
		method: 'post',
		data,
	});
}
export function removePt(data) {
	return request({
		url: '/api/pc/ptGoods/removePt',
		method: 'delete',
		data,
	});
}
export function getPtRecordList(data) {
	return request({
		url: '/pt/record/signList',
		method: 'post',
		data,
	});
}
